﻿using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Markup;

namespace Base.ModuleBase.Converters
{
    /// <summary>
    /// 转换器基类，用以支持多条件转换，例如：
    /// {Binding ... ,Converter={converters:BoolToVisibilityConverter Property1=xx,Property2=XX ...}}
    /// </summary>
    public abstract class ConverterBase : MarkupExtension, IValueConverter
    {
        public abstract object Convert(object value, Type targetType, object parameter, CultureInfo culture);

        public abstract object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture);

        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            return this;
        }
    }
}
